<@pp.dropOutputFile/>
<#include "../common/util.ftl">
<#include "../common/validation.ftl">
<#-- generate package name -->

<#-- iterate table list-->
<#list doc.tables as table>
<#assign module = doc.artifactid?replace(".", "/") + "/" + table.moduleid?uncap_first>
<#assign fileName = table.name?cap_first>
<#assign data_url = "/" + module + "/" + fileName + "/">
<@pp.changeOutputFile name="/main/webapp/" + module + "/" + fileName + "/input.html"/>
<!DOCTYPE html>
<html>
<head>
<title>${fileName}<#noparse> test!</title>
<#assign base="${request.getContextPath()}">
<#include "/common/import_m_easyui_css.ftl">
<#include "/common/import_m_easyui_js.ftl">
<script type="text/javascript"><#include "input_js.ftl"></script>
</head>

<body>
	<div class="container">
		<div class="row">
			<div class="col-sm-8 col-sm-offset-2">
				<div class="page-header">
					<h2 class="text-center"></#noparse>${table.comment}<#noparse>数据录入</h2>
				</div>
				<div id="alert_success" class="alert alert-success hidden" role="alert"></div>
				<div id="alert_fail" class="alert alert-danger hidden" role="alert"></div>
				<div class="panel panel-default">
					<div class="panel-heading">
						<h3 class="panel-title"></#noparse>${table.comment}<#noparse></h3>
					</div>
					<div class="panel-body">
						<form id="addForm" class="form-horizontal" role="form" method="post">
							</#noparse>
							<#list table.fields as field>
							<div class="form-group">
								<label  class="col-sm-4 control-label" for="obj.${field.name}">${field.label}</label>
								<div class="col-sm-5">
									<#if field.options?? && (field.options?length > 0)>
									<select id="obj.${field.name}" name="obj.${field.name}" placeholder="${field.label}" class="form-control">
										<#list field.options as op>
										<option value="${op.value}">${op.label}</option>
										</#list>
									</select>
									<#elseif field.type == "datetime">
									<input type="text" id="obj.${field.name}" name="obj.${field.name}" placeholder="${field.label}" class="form-control form_datetime">
									<#else>
									<input type="${getHTML5type(field.type)}" id="obj.${field.name}" name="obj.${field.name}" placeholder="${field.label}" class="form-control">
									</#if>
								</div>
							</div>
							</#list>
							<#noparse>
							<div class="form-group">
								<div class="col-sm-9 col-sm-offset-4">
									<button type="button" onclick="add()" class="btn btn-primary" name="submit" value="提交">提交</button>
								</div>
							</div>
						</form>
					</div>
				</div>
			</div>
		</div>
	</div>
</body>
</html>
</body>
</html>
</#noparse>
</#list>